<?php
getHeader();

if (!isset($_SESSION['authPassed']))
{
	?>
<div id="content">
<div class="tabs headTabs">
<ul>
	<li><a href='?p=uploadFile' class="TabLink">上传文件</a></li>
</ul>
<span>文件上传</span></div>
<div class="dataList"><span>你未<a href='?p=login'>登录</a>, 不能上传文件.</span>
</div>
</div>
	<?php
}
else if (isset($_FILES['uploadFile']))
{
	?>
<div id="content">
<div class="tabs headTabs">
<ul>
	<li><a href='?p=uploadFile' class="TabLink">上传文件</a></li>
</ul>
<span>文件上传</span></div>
<div class="dataList"><span> <?php
$up = new fileUpload();
switch ($up->doUpload($_FILES['uploadFile'],$_SESSION['userName'],$_SESSION['uid']))
{
	case 0:
		echo "上传成功.";
		break;
			
	case 1:
		echo "文件类型或大小不符合要求, 上传失败.";
		break;

	case 2:
		echo "该文件名已存在, 请修改同名文件后再上传.";
		break;
	default:
		echo "";
}
?> <a href='?p=uploadFile'>继续上传</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
	href='?p=viewUser'>返回</a> </span></div>
</div>
<?php
}
else
{
	?>
<div id="content">
<div class="tabs headTabs">
<ul>
	<li><a href='?p=uploadFile' class="TabLink">上传文件</a></li>
</ul>
<span>文件上传</span></div>
<div class="dataList">
<form action='?p=uploadFile' method='post' enctype='multipart/form-data'>
<span>文件: </span><input type="file" name="uploadFile" /><br />
<input type="submit" name="submit" value="上传" class="button" /></form>
</div>
</div>
	<?php
}

getPanel();
getFooter();
?>